 <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import="com.spoto.oa.model.*" isELIgnored="false"%>
<%@ page import="com.spoto.oa.util.*"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">


		<link href="style/v1/common/welcome.css" rel="stylesheet">
		<script type="text/javascript" src="js/lib/jquery-1.4.2.js">

</script>
		<script type="text/javascript" src="js/lib/jquery.validate.js">

</script>

		<script src="js/common/list.js" type="text/javascript">

</script>

	</head>

	<body>
		<div id="welcome">

			<%
				Object ob = request.getAttribute("customers");
				if (null != ob) {
					PageUtil pc = new PageUtil();
					String searchType = request.getParameter("searchType");
					String type=request.getParameter("op_type");
					String kind=request.getParameter("kind");
					String info = request.getParameter("infor");
					pc.setCurrentPage(request.getParameter("page"));	//设置当前页面
					pc.setPageCount(2);		//设置每页记录数
					pc.setRecordCount(((List<Customer>) ob).size());	//设置记录条数
					pc.setPageUrl("CustomerServlet?op_type=" + type + "&searchType="
							+ searchType + "&infor=" + info+"&kind="+kind); //设置跳转页面url
					List<Customer> customers = pc.getSubList((List<Customer>) ob); //获取当前页面记录
					if (customers.isEmpty()) {
			%>
			<center>
				不存在冲突的数据
			</center>
			<%
				} else {
			%>
			发生冲突的数据
			<div id="list">
				<div class="view">
				<form action="CustomerServlet?type=conflict&kind=multi_del" method="post">
					 <div id="table-ope-left">
				    <input type="hidden" name="op_type" value="multi_del" />
					<button type="button" class="select_btn" name="select_all">全选</button>
					<button type="button" class="select_btn" name="select_reverse">反选</button>
					<button type="button" class="select_btn" name="select_cancel">取消</button>
					<input type="submit" id="mul-del" value="删除选中" />
					</div>
					<div id="table-ope-right">
						<%=pc.getPageJumpLinkHtml() 
						%>
						
					</div>
					<div id="c"></div>

					<table class="table">
						<tr class="firstrow">
							<td>
								客户姓名 
							</td>
							<td>
								公司名称
							</td>
							<td>
								手机号码
							</td>
							<td>
								重要程度
							</td>
							<td>
								操作
							</td>
						</tr>
						<%
							int i = 0;
									for (Customer e : customers) {
										i++;
						%>


						<tr>
							<td style="text-align:left">
								<input type="checkbox" name="del-flag" value="<%=e.getName()%>"/>
								<a  href="CustomerServlet?op_type=conflict&kind=to_update&name=<%=e.getName()%>"><%
									out.print(e.getName());
								%></a>
								
								
							</td>
							<td>
								<%=e.getCompany() %>
							</td>
							<td>
							<%=e.getMobile() %>
							</td>
							<td>
							<%=e.getLevel() %>
							</td>
							<td>
								<a
									href="CustomerServlet?name=<%=e.getName()%>&op_type=conflict&kind=delete"
									onclick="return isDelete()">删除</a>
								<a
									href="CustomerServlet?name=<%=e.getName()%>&op_type=conflict&kind=to_update">修改</a>
							</td>
						</tr>


						<%
							}
						%>

					</table>
					</form>					
					<div class="page-no">
						<ul>
						<%=	pc.getJavaScriptJumpCode() %>
							<li id="statue">
								<%=pc.getPageCountHtml()%>
							</li>
							<li class="jump">
								<%=pc.getPageFormJumpHtml()%>
							</li>
						</ul>

					</div>		

				</div>
				<%
					}
					}else{
					
					%>
					<center>
				不存在冲突的数据
			</center>
					<%}
				%>
			</div>


		</div>

	</body>
</html>
